import {
    service
} from '@/utils/request'

//申购订单
export function subscribe(form) {
    return service({
        url: '/order/subscribe',
        method: 'post',
        data: {
            "orderCount": '',
            "orderAmount": form.orderAmount,
            "fundId": form.fundId,
            "orderStatus": "CREATED",
            "orderType": "SUBSCRIPTION",
            "createTime": '1995-05-29T13:12:34.0Z',
            "orderId": 1,
            "cardId": form.cardId,
            "consumerId": form.consumerId
        }
    })
}

export function fundsell(form) {
    return service({
        url: '/order/fundsell',
        method: 'post',
        data: {
            "orderCount": '',
            "orderAmount": form.orderAmount,
            "fundId": form.fundId,
            "orderStatus": "CREATED",
            "orderType": "REDEMPTION",
            "createTime": '',
            "orderId": '',
            "cardId": form.cardId,
            "consumerId": form.consumerId
        }
    })
}

export function getOrderInfo(cId, orderType) {
    return service({
        url: '/order/getOrderDetailList',
        method: 'put',
        data: {
            "orderAmount": null,
            "orderStatus": null,
            "fundId": null,
            "consumerId": cId,
            "orderId": null,
            "orderCount": null,
            "createTime": null,
            orderType,
            "cardId": 2
        }
    })
}



export function reflash() {
    return service({
        url: '/order/refresh',
        method: 'post',
    })
}